<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
<head>
    <title>通用网关服务</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/Css/bootstrap.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/Css/bootstrap-responsive.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/Css/style.css}" />
    <script type="text/javascript" th:src="@{/Js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/Js/jquery.sorted.js}"></script>
    <script type="text/javascript" th:src="@{/Js/bootstrap.js}"></script>
    <script type="text/javascript" th:src="@{/Js/ckform.js}"></script>
    <script type="text/javascript" th:src="@{/Js/common.js}"></script>
    <script type="text/javascript" th:src="@{/Js/jquery.funkyUI.js}"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }
        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
</head>
<form th:action="@{/Node/save}" method="post" onsubmit="check()">
	<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">网关名称</td>
        <td><input type="text" id="name" name="name"/></td>
    </tr>
    <tr>
        <td class="tableleft">拦截Path</td>
        <td><input type="text" id="path" name="path"/></td>
    </tr>
     <tr>
        <td class="tableleft">转发URL</td>
        <td><input type="text" id="url" name="url"/></td>
    </tr>    
    <tr>
        <td class="tableleft">服务编号</td>
        <td><input type="text" id="serviceId" name="serviceId"/></td>
    </tr>
    <tr>
        <td class="tableleft"></td>
        <td>
            <button type="submit" class="btn btn-primary">保存</button>&nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
        </td>
    </tr>
</table>
</form>
</body>
</html>
<script>
    
    $(function () {       
		$('#backid').click(function(){
				window.location.href="/Node/index";
		 });
		function check(){
	    	alert($('#name').val());
			if($('#name').val() == "" || $('#name').val() == null){
				$.alert("网关名称不可以为空！");
				return false;
			}
			if($('#path').val() == "" || $('#path').val() == null){
				$.alert("网关path不可以为空！");
				return false;
			}
			if($('#url').val() == "" || $('#url').val() == null){
				$.alert("网关Url不可以为空！");
				return false;
			}
			return true;
		}
    });
    /* 
     
    */
</script>